/**
 * @Author: Boring
 * @Description:
 * @File:  namespace
 * @Date: 2024-03-02 14:50
 */

package namespace

import (
	"github.com/gin-gonic/gin"
	"oam-manage-backend/controllers/namespace"
)

func create(namespaceGroup *gin.RouterGroup) {
	namespaceGroup.POST("/create", namespace.Create)
}

func update(namespaceGroup *gin.RouterGroup) {
	namespaceGroup.PUT("/update", namespace.Update)
}

func delete(namespaceGroup *gin.RouterGroup) {
	namespaceGroup.DELETE("/delete", namespace.Delete)
}

func get(namespaceGroup *gin.RouterGroup) {
	namespaceGroup.GET("/get", namespace.Get)
}

func list(namespaceGroup *gin.RouterGroup) {
	namespaceGroup.GET("/list", namespace.List)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	namespaceGroup := g.Group("/namespace")
	create(namespaceGroup)
	update(namespaceGroup)
	delete(namespaceGroup)
	get(namespaceGroup)
	list(namespaceGroup)
}
